package com.firesys.httpserver;





import com.firesys.dbhelper.SharedPreferenceUtil;
import com.firesys.dbhelper.XmlNameHelper;

import android.content.Context;



/**
 * 向服务器请求参数
 * 
 * @author king
 * 
 */
public class RequestUrl {

    public static final String USERLOGIN = "/afa!add.action";// 登录请求
    
   public static final String UPLOADCOPYDATA="/load!water.action";//上传抄表数据
    
    public static final String MODIFYPASS="/hca!update.action";//用户修改密码请求

    public static final String BandingWater = "/uploadGIS.action";// 水表绑定上传请求

    public static final String DownloadWaterList = "/hca!down.action";// 下载表册请求
    
    public static final String UPLOADTUWENDATA="/upImageAndText.action";//上传图文

    public static final String UploadOrder = "/upload!add.action";// 上传工程单请求
   
    public static final String TimingLocation = "/location!add.action";// 定时定位请求
 
    public static final String IMAGE_TEXT_UPLOAD = "/nineCell!add.action";// 图文上传
    
    public static final String ReWaterinfo="/load!change.action";//换表上传
    
    //检测与服务器的连接
    public static final String CheckConnect="/onlineTest.action";
    
    //下载表册后返回给后台数据
    public static final String CALLBACKWATERLIST="/la!ok.action";
    
    //下载巡检单
    public static final String DOWNLOAD_ROUNTING_DEVICE="/downloadInspectJobList.action";
    
    //下载保养清单
    public static final String DOWNLOAD_MAITAIN_DEVICE="/downloadKeepJobList.action";
    
    //上传结果数据 
    public static final String UPLOAD_DATA="/uploadData.action";
    
    //下载维修单数据
    public static final String DOWNLOAD_REPAIR_DEVVICE="/downloadRepairJobList.action";
    
    //上传设备状态
    public static final String UPLOAD_DEVICE_OPENSTATUS="/uploadSwitch.action";

    private SharedPreferenceUtil sp;

    public RequestUrl(Context context) {
	sp = new SharedPreferenceUtil(context);
    }

    public String getUrl(String reques) {

	StringBuffer sb = new StringBuffer("http://");
	sb.append(sp.getValue(XmlNameHelper.IP)).append(":").append(sp.getValue(XmlNameHelper.port));
	sb.append("/").append(sp.getValue(XmlNameHelper.webName)).append(reques);

	return sb.toString();

    }
}
